# -*- coding: utf-8 -*-

# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html

import scrapy


class XiangmuItem(scrapy.Item):
    # define the fields for your item here like:
    # name = scrapy.Field()
    pass

class Zhilian(scrapy.Item):
    wangzhan = scrapy.Field()
    title = scrapy.Field()
    price = scrapy.Field()
    weizhi = scrapy.Field()
    jingyan = scrapy.Field()
    xueli = scrapy.Field()
    shijian = scrapy.Field()
    info = scrapy.Field()

    def get_insert_sql_and_data(self):
        wangzhan = self['wangzhan']
        title = self['title']
        price = self['price']
        weizhi = self['weizhi']
        jingyan = self['jingyan']
        xueli = self['xueli']
        shijian = self['shijian']
        info = self['info']

        insert_sql = 'INSERT INTO jobtest(wangzhan,title,price,weizhi,jingyan,xueli,shijian,info)VALUES(%s,%s,%s,%s,%s,%s,%s,%s)'
        data = (wangzhan, title, price, weizhi, jingyan, xueli, shijian, info)

        return (insert_sql, data)
    
